fix(sandbox): allow first-label L7 host wildcards#1304
Conversation
|
This changes the documented host wildcard contract, but The validator test covers |
|
@mjamiv are you gonna enhance the PR ? I created the issue so I can also create the PR if this one becomes stuck. |
|
Thanks for the nudge — I'm enhancing the PR now. @johntmyers's review asks are clear: a Host Wildcards section in |
…ests - Add Host Wildcards section to architecture/security-policy.md describing accepted (first-label *, **, intra-label *-X) and rejected (bare, TLD, non-first-label, recursive-in-label) forms, and noting that wildcards never cross '.' boundaries. - Expand the policy-schema.mdx 'host' field description to reflect the same contract instead of only mentioning '*.example.com'. - Add OPA runtime tests asserting '*-aiplatform.googleapis.com' matches 'us-central1-aiplatform.googleapis.com' and does not match 'us-central1.aiplatform.googleapis.com' (cross-dot boundary). Locks validator/runtime alignment for intra-label wildcards.
|
Addressed in Docs (architecture/security-policy.md): added a Host Wildcards section with a validation table covering accepted ( Docs (docs/reference/policy-schema.mdx): expanded the OPA runtime tests: added two tests in
Local validation:
|
Summary
*-aiplatform.googleapis.com**inside a labelRelated Issue
Fixes #1303
Changes
*./**.prefix requirement with label-position validation that matches the OPAglob.match(..., ["."])boundary model.*-aiplatform.googleapis.com,**.example.com,foo.*.example.com,foo**.example.com,*com, bare*/**, and TLD wildcards.Testing
mise run pre-commitcargo fmt --all -- --checkgit diff --checkcargo test -p openshell-sandbox validate_wildcard_host -- --nocapturecargo test -p openshell-sandboxcargo clippy -p openshell-sandbox --all-targets -- -D warningsChecklist